Optimal. Leaf size=73 \[ \frac {a^2 (A-2 B) \sec (c+d x)}{3 d}+\frac {(A+B) \sec ^3(c+d x) (a+a \sin (c+d x))^2}{3 d}+\frac {a^2 (A-2 B) \tan (c+d x)}{3 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.08, antiderivative size = 73, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 4, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.129, Rules used = {2934, 2748,
3852, 8} \begin {gather*} \frac {a^2 (A-2 B) \tan (c+d x)}{3 d}+\frac {a^2 (A-2 B) \sec (c+d x)}{3 d}+\frac {(A+B) \sec ^3(c+d x) (a \sin (c+d x)+a)^2}{3 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2748
Rule 2934
Rule 3852
Rubi steps
\begin {align*} \int \sec ^4(c+d x) (a+a \sin (c+d x))^2 (A+B \sin (c+d x)) \, dx &=\frac {(A+B) \sec ^3(c+d x) (a+a \sin (c+d x))^2}{3 d}+\frac {1}{3} (a (A-2 B)) \int \sec ^2(c+d x) (a+a \sin (c+d x)) \, dx\\ &=\frac {a^2 (A-2 B) \sec (c+d x)}{3 d}+\frac {(A+B) \sec ^3(c+d x) (a+a \sin (c+d x))^2}{3 d}+\frac {1}{3} \left (a^2 (A-2 B)\right ) \int \sec ^2(c+d x) \, dx\\ &=\frac {a^2 (A-2 B) \sec (c+d x)}{3 d}+\frac {(A+B) \sec ^3(c+d x) (a+a \sin (c+d x))^2}{3 d}-\frac {\left (a^2 (A-2 B)\right ) \text {Subst}(\int 1 \, dx,x,-\tan (c+d x))}{3 d}\\ &=\frac {a^2 (A-2 B) \sec (c+d x)}{3 d}+\frac {(A+B) \sec ^3(c+d x) (a+a \sin (c+d x))^2}{3 d}+\frac {a^2 (A-2 B) \tan (c+d x)}{3 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.02, size = 121, normalized size = 1.66 \begin {gather*} \frac {2 a^2 A \sec ^3(c+d x)}{3 d}-\frac {a^2 B \sec ^3(c+d x)}{3 d}+\frac {a^2 A \sec ^2(c+d x) \tan (c+d x)}{d}+\frac {a^2 B \sec (c+d x) \tan ^2(c+d x)}{d}-\frac {a^2 A \tan ^3(c+d x)}{3 d}+\frac {2 a^2 B \tan ^3(c+d x)}{3 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(161\) vs.
\(2(67)=134\).
time = 0.24, size = 162, normalized size = 2.22
method | result | size |
risch | \(-\frac {2 \left (-3 i B \,a^{2} {\mathrm e}^{i \left (d x +c \right )}+3 B \,a^{2} {\mathrm e}^{2 i \left (d x +c \right )}+a^{2} A -2 B \,a^{2}+3 i A \,a^{2} {\mathrm e}^{i \left (d x +c \right )}\right )}{3 \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )^{3} d}\) | \(79\) |
derivativedivides | \(\frac {-a^{2} A \left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (d x +c \right )\right )}{3}\right ) \tan \left (d x +c \right )+\frac {B \,a^{2}}{3 \cos \left (d x +c \right )^{3}}+\frac {2 a^{2} A}{3 \cos \left (d x +c \right )^{3}}+\frac {2 B \,a^{2} \left (\sin ^{3}\left (d x +c \right )\right )}{3 \cos \left (d x +c \right )^{3}}+\frac {a^{2} A \left (\sin ^{3}\left (d x +c \right )\right )}{3 \cos \left (d x +c \right )^{3}}+B \,a^{2} \left (\frac {\sin ^{4}\left (d x +c \right )}{3 \cos \left (d x +c \right )^{3}}-\frac {\sin ^{4}\left (d x +c \right )}{3 \cos \left (d x +c \right )}-\frac {\left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )}{3}\right )}{d}\) | \(162\) |
default | \(\frac {-a^{2} A \left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (d x +c \right )\right )}{3}\right ) \tan \left (d x +c \right )+\frac {B \,a^{2}}{3 \cos \left (d x +c \right )^{3}}+\frac {2 a^{2} A}{3 \cos \left (d x +c \right )^{3}}+\frac {2 B \,a^{2} \left (\sin ^{3}\left (d x +c \right )\right )}{3 \cos \left (d x +c \right )^{3}}+\frac {a^{2} A \left (\sin ^{3}\left (d x +c \right )\right )}{3 \cos \left (d x +c \right )^{3}}+B \,a^{2} \left (\frac {\sin ^{4}\left (d x +c \right )}{3 \cos \left (d x +c \right )^{3}}-\frac {\sin ^{4}\left (d x +c \right )}{3 \cos \left (d x +c \right )}-\frac {\left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )}{3}\right )}{d}\) | \(162\) |
norman | \(\frac {-\frac {4 a^{2} A -2 B \,a^{2}}{3 d}-\frac {\left (8 a^{2} A +12 B \,a^{2}\right ) \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {\left (12 a^{2} A +10 B \,a^{2}\right ) \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {2 a^{2} A \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}-\frac {2 a^{2} A \left (\tan ^{11}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {2 a^{2} \left (2 A +B \right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {2 a^{2} \left (2 A +B \right ) \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {4 a^{2} \left (3 A +4 B \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {4 a^{2} \left (3 A +4 B \right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {4 a^{2} \left (10 A +13 B \right ) \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}-\frac {2 a^{2} \left (11 A +8 B \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}-\frac {2 a^{2} \left (11 A +8 B \right ) \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}}{\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{3} \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3}}\) | \(325\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.30, size = 108, normalized size = 1.48 \begin {gather*} \frac {A a^{2} \tan \left (d x + c\right )^{3} + 2 \, B a^{2} \tan \left (d x + c\right )^{3} + {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} A a^{2} - \frac {{\left (3 \, \cos \left (d x + c\right )^{2} - 1\right )} B a^{2}}{\cos \left (d x + c\right )^{3}} + \frac {2 \, A a^{2}}{\cos \left (d x + c\right )^{3}} + \frac {B a^{2}}{\cos \left (d x + c\right )^{3}}}{3 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.37, size = 120, normalized size = 1.64 \begin {gather*} -\frac {{\left (A - 2 \, B\right )} a^{2} \cos \left (d x + c\right )^{2} + {\left (2 \, A - B\right )} a^{2} \cos \left (d x + c\right ) + {\left (A + B\right )} a^{2} - {\left ({\left (A - 2 \, B\right )} a^{2} \cos \left (d x + c\right ) - {\left (A + B\right )} a^{2}\right )} \sin \left (d x + c\right )}{3 \, {\left (d \cos \left (d x + c\right )^{2} - d \cos \left (d x + c\right ) + {\left (d \cos \left (d x + c\right ) + 2 \, d\right )} \sin \left (d x + c\right ) - 2 \, d\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} a^{2} \left (\int A \sec ^{4}{\left (c + d x \right )}\, dx + \int 2 A \sin {\left (c + d x \right )} \sec ^{4}{\left (c + d x \right )}\, dx + \int A \sin ^{2}{\left (c + d x \right )} \sec ^{4}{\left (c + d x \right )}\, dx + \int B \sin {\left (c + d x \right )} \sec ^{4}{\left (c + d x \right )}\, dx + \int 2 B \sin ^{2}{\left (c + d x \right )} \sec ^{4}{\left (c + d x \right )}\, dx + \int B \sin ^{3}{\left (c + d x \right )} \sec ^{4}{\left (c + d x \right )}\, dx\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.47, size = 78, normalized size = 1.07 \begin {gather*} -\frac {2 \, {\left (3 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 3 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 2 \, A a^{2} - B a^{2}\right )}}{3 \, d {\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1\right )}^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 9.15, size = 77, normalized size = 1.05 \begin {gather*} -\frac {\sqrt {2}\,a^2\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {B}{2}-\frac {5\,A}{2}+\frac {A\,\cos \left (c+d\,x\right )}{2}+\frac {B\,\cos \left (c+d\,x\right )}{2}+\frac {3\,A\,\sin \left (c+d\,x\right )}{2}-\frac {3\,B\,\sin \left (c+d\,x\right )}{2}\right )}{6\,d\,{\cos \left (\frac {c}{2}+\frac {\pi }{4}+\frac {d\,x}{2}\right )}^3} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________